package util;/**
 * @author ：dechang.zhang
 * @description：
 * @Date： 2018/10/8 16:52:17
 */

import com.alibaba.fastjson.JSONArray;

import java.util.List;

/**
 * @author dechang.zhang
 * @date 2018/10/8 16:52:17
 */
public class CaroptapiExcelDeal {
    public static JSONArray getData(String filePath) {
        List dataList = ReadExcel.readExcel(filePath);
        String content = "[[]";
        for (int i = 1; i < dataList.size(); i++) {
            List list = (List) dataList.get(i);
            content += ",[\"\"";
            for (int j = 1; j < 7; j = j + 5) {
                content += ",\"";
                content += list.get(j);
                content += "\"";
            }
            content += "]";
        }
        content += "]";
        JSONArray dataArr = (JSONArray) JSONArray.parse(content);
        dataArr.remove(0);
        return dataArr;
    }
}
